package com.jhopesoft.framework.dao.entity.dataobject;
// Generated 2019-5-27 14:39:53 by Hibernate Tools 5.2.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import com.jhopesoft.framework.dao.entityinterface.AdditionFieldAbstract;
import com.jhopesoft.framework.dao.entity.limit.FUserdataobjecthintmessage;

/**
 * FDataobjecthintmessage generated by hbm2java
 */
@Entity
@SuppressWarnings("serial")
@DynamicUpdate
@Table(name = "f_dataobjecthintmessage")
public class FDataobjecthintmessage extends AdditionFieldAbstract {

	private String hintmessageid;
	private FDataobject FDataobject;
	private String title;
	private String hintlevel;
	private int orderno;
	private String messagetitle;
	private String messagetpl;
	private String filterfieldname;
	private String fieldfieldoperator;
	private String filterfieldvalue;
	private String filtertext;
	private boolean allowopenmodule;
	private boolean enabled;
	private Date startdate;
	private Date enddate;
	private String remark;
	private String creater;
	private Date createdate;
	private String lastmodifier;
	private Date lastmodifydate;
	private Set<FUserdataobjecthintmessage> FUserdataobjecthintmessages = new HashSet<FUserdataobjecthintmessage>(0);
	
	public FDataobjecthintmessage() {
	}

	/**
	 * 是否在开始日期和结束日期之间
	 * 
	 * @return
	 */
	public boolean inDate() {
		if (startdate == null && enddate == null) {
			return true;
		}
		Date now = new Date();
		if (startdate != null && enddate == null) {
			return now.after(startdate);
		}
		if (startdate == null && enddate != null) {
			return now.before(enddate);
		}
		return now.after(startdate) && now.before(enddate);
	}

	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "hintmessageid", unique = true, nullable = false, length = 40)
	public String getHintmessageid() {
		return this.hintmessageid;
	}

	public void setHintmessageid(String hintmessageid) {
		this.hintmessageid = hintmessageid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "objectid")
	public FDataobject getFDataobject() {
		return this.FDataobject;
	}

	public void setFDataobject(FDataobject FDataobject) {
		this.FDataobject = FDataobject;
	}

	@Column(name = "title", nullable = false, length = 50)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "hintlevel", nullable = false, length = 20)
	public String getHintlevel() {
		return this.hintlevel;
	}

	public void setHintlevel(String hintlevel) {
		this.hintlevel = hintlevel;
	}

	@Column(name = "orderno", nullable = false)
	public int getOrderno() {
		return this.orderno;
	}

	public void setOrderno(int orderno) {
		this.orderno = orderno;
	}

	@Column(name = "messagetitle", nullable = false, length = 50)
	public String getMessagetitle() {
		return this.messagetitle;
	}

	public void setMessagetitle(String messagetitle) {
		this.messagetitle = messagetitle;
	}

	@Column(name = "messagetpl", nullable = false, length = 4000)
	public String getMessagetpl() {
		return this.messagetpl;
	}

	public void setMessagetpl(String messagetpl) {
		this.messagetpl = messagetpl;
	}

	@Column(name = "filterfieldname", length = 200)
	public String getFilterfieldname() {
		return this.filterfieldname;
	}

	public void setFilterfieldname(String filterfieldname) {
		this.filterfieldname = filterfieldname;
	}

	@Column(name = "fieldfieldoperator", length = 200)
	public String getFieldfieldoperator() {
		return this.fieldfieldoperator;
	}

	public void setFieldfieldoperator(String fieldfieldoperator) {
		this.fieldfieldoperator = fieldfieldoperator;
	}

	@Column(name = "filterfieldvalue", length = 200)
	public String getFilterfieldvalue() {
		return this.filterfieldvalue;
	}

	public void setFilterfieldvalue(String filterfieldvalue) {
		this.filterfieldvalue = filterfieldvalue;
	}

	@Column(name = "filtertext", length = 200)
	public String getFiltertext() {
		return this.filtertext;
	}

	public void setFiltertext(String filtertext) {
		this.filtertext = filtertext;
	}

	@Column(name = "allowopenmodule", nullable = false)
	public boolean isAllowopenmodule() {
		return this.allowopenmodule;
	}

	public void setAllowopenmodule(boolean allowopenmodule) {
		this.allowopenmodule = allowopenmodule;
	}

	@Column(name = "enabled", nullable = false)
	public boolean isEnabled() {
		return this.enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "startdate", length = 10)
	public Date getStartdate() {
		return this.startdate;
	}

	public void setStartdate(Date startdate) {
		this.startdate = startdate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "enddate", length = 10)
	public Date getEnddate() {
		return this.enddate;
	}

	public void setEnddate(Date enddate) {
		this.enddate = enddate;
	}

	@Column(name = "remark", length = 200)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "creater", nullable = false, length = 40)
	public String getCreater() {
		return this.creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "createdate", nullable = false, length = 19)
	public Date getCreatedate() {
		return this.createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	@Column(name = "lastmodifier", length = 40)
	public String getLastmodifier() {
		return this.lastmodifier;
	}

	public void setLastmodifier(String lastmodifier) {
		this.lastmodifier = lastmodifier;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "lastmodifydate", length = 19)
	public Date getLastmodifydate() {
		return this.lastmodifydate;
	}

	public void setLastmodifydate(Date lastmodifydate) {
		this.lastmodifydate = lastmodifydate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "FDataobjecthintmessage")
	public Set<FUserdataobjecthintmessage> getFUserdataobjecthintmessages() {
		return this.FUserdataobjecthintmessages;
	}

	public void setFUserdataobjecthintmessages(Set<FUserdataobjecthintmessage> FUserdataobjecthintmessages) {
		this.FUserdataobjecthintmessages = FUserdataobjecthintmessages;
	}

}
